home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-07-02 | 708 b | 27 lines | [TEXT/MPS ] |
- #!./perl
-
- $^I = '.bak';
-
- # $RCSfile: inplace.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:29 $
-
- print "1..2\n";
-
- @ARGV = ('.a','.b','.c');
- # `echo foo | tee .a .b .c`;
- `echo foo >.a`;
- `echo foo >.b`;
- `echo foo >.c`;
- while (<>) {
- s/foo/bar/;
- }
- continue {
- print;
- }
-
- # if (`cat .a .b .c` eq "bar\nbar\nbar\n") {print "ok 1\n";} else {print "not ok 1\n";}
- # if (`cat .a.bak .b.bak .c.bak` eq "foo\nfoo\nfoo\n") {print "ok 2\n";} else {print "not ok 2\n";}
- if (`catenate .a .b .c` eq "bar\nbar\nbar\n") {print "ok 1\n";} else {print "not ok 1\n";}
- if (`catenate .a.bak .b.bak .c.bak` eq "foo\nfoo\nfoo\n") {print "ok 2\n";} else {print "not ok 2\n";}
-
- unlink '.a', '.b', '.c', '.a.bak', '.b.bak', '.c.bak';
-